﻿using System.Security.Cryptography;
using System.Text;
using System.IO;
using System;

class Program
{
    const int BUFF_SIZE = 4 * 1024;
    static void Main()
    {        
        SHA1 sha = new SHA1CryptoServiceProvider();
        using (FileStream readFile = new FileStream("asd.txt",FileMode.Open))
        {
            byte[] fileContent = new byte[readFile.Length];
            int offset = 0;
            while (true)
            {
                int readLength = readFile.Read(fileContent, offset, (int)readFile.Length - offset);
                if (readLength == 0)
                {
                    byte[] hash = sha.ComputeHash(fileContent);
                    foreach (byte item in hash)
                    {
                        Console.Write("{0:x} ",item);
                    }
                    Console.WriteLine();
                    break;
                }
                offset += readLength;
            }
        }
    }
}
